<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
            width: 800px;
            height: 600px;
            margin: 100px auto;
            outline: 1px solid black;
        }

        .box {
            width: 100px;
            height: 100px;
            outline: 1px solid red;
            float: left;
            margin-right: 40px;
            margin-top: 250px;
        }

        .box:last-child {
            margin-right: 0;
        }
        /* 使用弹性布局 */
        .container1 {
            width: 800px;
            height: 600px;
            margin: 100px auto;
            outline: 1px solid black;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .box1 {
            width: 100px;
            height: 100px;
            outline: 1px solid red;
          
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="box b1"></div>
        <div class="box b2"></div>
        <div class="box b3"></div>
        <div class="box b4"></div>
        <div class="box b5"></div>
        <div class="box b6"></div>

    </div>
    <div class="container1">
        <div class="box1 b1"></div>
        <div class="box1 b2"></div>
        <div class="box1 b3"></div>
        <div class="box1 b4"></div>
        <div class="box1 b5"></div>
        <div class="box1 b6"></div>

    </div>

</body>

</html>